package net.lab1024.sa.admin.module.system.user.dao;

import java.util.List;
import net.lab1024.sa.admin.module.system.user.domain.entity.UserEntity;
import net.lab1024.sa.admin.module.system.user.domain.form.UserQueryForm;
import net.lab1024.sa.admin.module.system.user.domain.vo.UserVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 用户表 Dao
 *
 * @Author jabari
 * @Date 2023-06-12 14:10:13
 * @Copyright 51dev.cn
 */

@Mapper
@Component
public interface UserDao extends BaseMapper<UserEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<UserVO> queryPage(Page page, @Param("queryForm") UserQueryForm queryForm);

    /**
     * 更新删除状态
     */
    long updateDeleted(@Param("userId")Integer userId,@Param("deletedFlag")boolean deletedFlag);
    /**
     * 批量更新删除状态
     */
    void batchUpdateDeleted(@Param("idList")List<Integer> idList,@Param("deletedFlag")boolean deletedFlag);

}
